<!--  -->
<template>
  <div class="harvestaddress">
    <van-nav-bar
      @click-left="onClickLeft"
      @click-right="onClickRight"
      title="收货地址"
      :left-arrow="true"
    >
      <slot slot="right" name="right"> 添加 </slot>
    </van-nav-bar>
    <ul class="list">
      <li>
        <div class="main">
          <div class="user">
            <div class="name">李大白</div>
            <div class="tel">176****0817</div>
          </div>
          <div class="address">
            <span class="default">默认</span>
            <span class="label">家</span>
            北京市 通州区 玉桥街道 运河西大街86号时尚街区南里
          </div>
          <div class="setup">
            <div class="defaultbtn">
              <van-checkbox v-model="checked">复选框</van-checkbox>
            </div>
            <div class="del">
              <img src="@/assets/img/harvestaddress/del.png" />
              删除
            </div>
          </div>
        </div>
      </li>
      <li>
        <div class="main">
          <div class="user">
            <div class="name">李大白</div>
            <div class="tel">176****0817</div>
          </div>
          <div class="address">
            <span class="default">默认</span>
            <span class="label">家</span>
            北京市 通州区 玉桥街道 运河西大街86号时尚街区南里
          </div>
          <div class="setup">
            <div class="defaultbtn">
              <van-checkbox v-model="checked">复选框</van-checkbox>
            </div>
            <div class="del">
              <img src="@/assets/img/harvestaddress/del.png" />
              删除
            </div>
          </div>
        </div>
      </li>
      <li>
        <div class="main">
          <div class="user">
            <div class="name">李大白</div>
            <div class="tel">176****0817</div>
          </div>
          <div class="address">
            <span class="default">默认</span>
            <span class="label">家</span>
            北京市 通州区 玉桥街道 运河西大街86号时尚街区南里
          </div>
          <div class="setup">
            <div class="defaultbtn">
              <van-checkbox v-model="checked">复选框</van-checkbox>
            </div>
            <div class="del">
              <img src="@/assets/img/harvestaddress/del.png" />
              删除
            </div>
          </div>
        </div>
      </li>
      <li>
        <div class="main">
          <div class="user">
            <div class="name">李大白</div>
            <div class="tel">176****0817</div>
          </div>
          <div class="address">
            <span class="default">默认</span>
            <span class="label">家</span>
            北京市 通州区 玉桥街道 运河西大街86号时尚街区南里
          </div>
          <div class="setup">
            <div class="defaultbtn">
              <van-checkbox v-model="checked">复选框</van-checkbox>
            </div>
            <div class="del">
              <img src="@/assets/img/harvestaddress/del.png" />
              删除
            </div>
          </div>
        </div>
      </li>
    </ul>
  </div>
</template>

<script>
//这里可以导入其他文件（比如：组件，工具js，第三方插件js，json文件，图片文件等等）
//例如：import 《组件名称》 from '《组件路径》';

export default {
  //import引入的组件需要注入到对象中才能使用
  components: {
    name: "harvestaddress",
  },
  data() {
    //这里存放数据
    return {
      checked: false,
    };
  },
  //监听属性 类似于data概念
  computed: {},
  //监控data中的数据变化
  watch: {},
  //方法集合
  methods: {
    onClickLeft() {
      this.$router.go(-1);
    },
    onClickRight() {
      this.$router.push({
        path: "/harvestaddressAdd",
        // query: {
        // },
      });
    },
  },
  //生命周期 - 创建完成（可以访问当前this实例）
  created() {},
  //生命周期 - 挂载完成（可以访问DOM元素）
  mounted() {},
  beforeCreate() {}, //生命周期 - 创建之前
  beforeMount() {}, //生命周期 - 挂载之前
  beforeUpdate() {}, //生命周期 - 更新之前
  updated() {}, //生命周期 - 更新之后
  beforeDestroy() {}, //生命周期 - 销毁之前
  destroyed() {}, //生命周期 - 销毁完成
  activated() {}, //如果页面有keep-alive缓存功能，这个函数会触发
};
</script>
<style scoped lang="less">
/* //@import url(); 引入公共css类 */
.harvestaddress {
  width: 100%;
  height: 100%;
  background: #f2f2f2;
  .list {
    padding: 10px;
    li {
      padding: 15px;
      background: #ffffff;
      border-radius: 6px;
      margin-bottom: 10px;
      .main {
        .user {
          display: flex;
          flex-direction: row;
          justify-content: space-between;
          align-items: center;
          margin-bottom: 6px;
          .name {
            font-size: 14px;
            font-family: PingFangSC, PingFangSC-Regular;
            font-weight: 400;
            color: #20253a;
          }
          .tel {
            font-size: 13px;
            font-family: PingFangSC, PingFangSC-Regular;
            font-weight: 400;
            color: #20253a;
          }
        }
        .address {
          font-size: 11px;
          font-family: PingFangSC, PingFangSC-Regular;
          font-weight: 400;
          color: #666666;
          line-height: 20px;
          border-bottom: 1px solid #f2f2f2;
          padding-bottom: 5px;
          .default {
            padding: 0px 4px;
            background: #fe0000;
            border-radius: 7px;
            font-size: 10px;
            font-family: PingFangSC, PingFangSC-Regular;
            font-weight: 400;
            color: #fefffe;
            margin-right: 5px;
          }
          .label {
            padding: 0px 8px;
            background: #5d5d5d;
            border-radius: 7px;
            font-size: 10px;
            font-family: PingFangSC, PingFangSC-Regular;
            font-weight: 400;
            color: #fefffe;
          }
        }
        .setup {
          display: flex;
          flex-direction: row;
          justify-content: space-between;
          align-items: center;
          margin-top: 10px;
          .defaultbtn {
            font-size: 11px;
            font-family: PingFangSC, PingFangSC-Regular;
            font-weight: 400;
            text-align: left;
            color: #000000;
          }
          .del {
            font-size: 11px;
            font-family: PingFangSC, PingFangSC-Regular;
            font-weight: 400;
            color: #666666;
            line-height: 20px;
            img {
              width: 17px;
              height: 16px;
              margin-right: 8px;
              vertical-align: middle;
              margin-top: -2px;
            }
          }
        }
      }
    }
  }
}
</style>